<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title><%= active.aName%>报名表打印</title>
<meta name="auther" content="F7" />
<style type="text/css">
  body { text-align:center;}
  table { border-collapse:collapse; width:94%; margin:0 auto 0;}
  td,th { padding:0; border:1px solid #333; line-height:34px; padding:5px 5px; font-size:14px;}

  h1 { line-height:240%; font-size:20px; padding-top:5px;}
</style>
</head>

<body>
<% 
  var count = 0;// 序号计数器
  var pagesize = 20;// 每页显示数量
  var max = Math.ceil(result.length/pagesize);
  var page = 1;// 当前页面标识
  var i = 0;
%>

  <h1> <%= active.aName%> 报名表  (<%= page %>/<%= max %>)</h1>
  <table>
    <thead>
      <tr>
        <th width="9%">序号</th>
        <th width="20%">姓名</th>
        <th>公司</th>
        <th width="22%">邀请码</th>
        <!-- <th width="11%">AA聚餐</th> -->
        <th width="14%">签名</th>
      </tr>
    </thead>
    <tbody>
  <% result.forEach(function(join){ %>
      <% 
        i++;
      %>
      <% if ( join.state !== 0 ) { %>
        <tr>
          <td><%= count+1 %></td>
          <td><%= join.name.substring(0, 8) %></td>
          <td><span style="display:block; height:30px; overflow:hidden;"><%= join.com %></span></td>
          <td><% if ( join.code ) { %>
              <%= active.aCodebefor %><% if ( (""+join.code).length < 3 ) { %><% if ( (""+join.code).length < 2 ) { %><%= "00"+join.code %><% } else { %><%= "0"+join.code %><% } %><% } else { %><%= join.code %><% } %>
              <% } else { %>
              -
              <% } %></td>
          <!-- <td></td> -->
          <td></td>
        </tr>

        <% 
          count++;
        %>

      <% } %>

    <% if ( count % pagesize === 0 && i+1 < result.length && join.state !== 0 ) { %>
      </tbody>
    </table>
    <% page++ %>

    <h1> <%= active.aName%> 报名表  (<%= page %>/<%= max %>)</h1>
    <table>
      <thead>
        <tr>
          <th width="9%">序号</th>
          <th width="20%">姓名</th>
          <th>公司</th>
          <th width="22%">邀请码</th>
          <!-- <th width="11%">AA聚餐</th> -->
          <th width="14%">签名</th>
        </tr>
      </thead>
      <tbody>
    <% } %>

  <% }) %>

  </tbody>
  </table>

</body>
</html>